'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)

	var db = uniCloud.database()
	const dbCmd = db.command
	var $ = db.command.aggregate
	return db.collection('shuoshuo_list').aggregate().lookup({
		from: "user-list",
		localField: 'user_id',
		foreignField: '_id',
		as: 'list'
	}).replaceRoot({
		newRoot: $.mergeObjects([$.arrayElemAt(['$list', 0]), '$$ROOT'])
	}).project({
		list: 0
	}).end()
};
